﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Employee/EmployeeMaster.Master"
    AutoEventWireup="true" CodeBehind="MakeRequest.aspx.cs" Inherits="LogicUniversity.Employee.MakeRequest" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<<<<<<< .mine
    <script src="http://code.jquery.com/jquery-1.10.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/AddItems.js" type="text/javascript" ></script>
    <script type="text/javascript">
        $(function () {
            $('#content_selectedItemView tr:first').remove();
            //$('#content_add').attr('disabled', true);
            
        });
    </script>
    <script type="text/javascript">
        var btn = $('#content_add');
        $('#content_CatelogueView tr').each(function () {

            
            if ($(this).children('input:checkbox').is(':checked')) {
                btn.attr('disabled', false);
                return false;
            }
            else {
                btn.attr('disabled', true);
            }
        });
    </script>
    <script src="http://code.jquery.com/jquery-1.10.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            //            console.log($('#navigation a').length);
            //            $('#navigation li').removeClass('active');
            //            $('#navigation li:last').addClass('active');

            $('.nav li a').each(function () {
                if ($(this).text() == 'Place Request') {
                    $(this).parent().addClass('active');
                }
            });
        });
    </script>
    
    <style type="text/css">
        noti_panel
        {
            display:none;
        }
    </style>
=======
    <script src="http://code.jquery.com/jquery-1.10.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/AddItems.js" type="text/javascript" ></script>
    <script type="text/javascript">
        $(function () {
            $('#content_selectedItemView tr:first').remove();
            //$('#content_add').attr('disabled', true);
            
        });
    </script>
    <script type="text/javascript">
        var btn = $('#content_add');
        $('#content_CatelogueView tr').each(function () {

            
            if ($(this).children('input:checkbox').is(':checked')) {
                btn.attr('disabled', false);
                return false;
            }
            else {
                btn.attr('disabled', true);
            }
        });
    </script>
>>>>>>> .r28
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
<<<<<<< .mine
    <form id="form_request" runat="server">
    <asp:HiddenField ID="noti" runat="server" />
=======
    <form id="form_request" runat="server">
>>>>>>> .r28
    <div class="row-fluid">
        <div class="span8">
            <div class="row-fluid">
<<<<<<< .mine
                <div class="hero-unit" runat="server" id="noti_panel">
                    <h4>
                        Hello,&nbsp;
                        <asp:Label  ID="lblName" runat="server" ></asp:Label>
                    </h4>
                    <p>
                        
                        You have been delegated as a department head temporarily. To process 
                        head's work, click the following button.
                    </p>
                    <p>
                        <asp:LinkButton  ID="btnGo" CssClass="btn btn-primary" runat="server" 
                            onclick="btnGo_Click">Go To Head's Site</asp:LinkButton>
                    </p>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span1 offset2">
=======
                <div class="span2">
>>>>>>> .r28
                    <asp:Label ID="lblCategory" runat="server" Text="Category"></asp:Label>
<<<<<<< .mine
                </div>
                <div class="span4">
                    <asp:DropDownList  ID="ddlCategory" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="ddlCategory_SelectedIndexChanged">
=======
                </div>
                <div class="span4">
                    <asp:DropDownList  ID="ddlCategory" runat="server">
>>>>>>> .r28
                    </asp:DropDownList>
<<<<<<< .mine
=======
                </div>
                <div class="span4">
                    <asp:LinkButton CssClass="btn" ID="btnSelect" runat="server" OnClick="btnSelect_Click">
                    <i class="icon-search"></i>&nbsp;
                         Select
                    </asp:LinkButton>
>>>>>>> .r28
                </div>
<<<<<<< .mine
                <div class="span4">
                </div>
             </div>
=======
             </div>
>>>>>>> .r28
            <div class="row-fluid">
<<<<<<< .mine
                <div class="span12" style="overflow-y:auto; height:auto;">
                    <asp:GridView ID="CatelogueView" GridLines="None" runat="server" AutoGenerateColumns="False"
                        CssClass="table table-hover" Width="598px">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:HiddenField ID="itemCode" Value='<%#Eval("Item_Code") %>' runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Item_Description" HeaderText="Description" />
                            <asp:BoundField DataField="Measurement" HeaderText="Unit Of Measurement" />
                            <asp:TemplateField HeaderText="Quantity">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtQty" pattern="[0-9]*"  runat="server" required="required" Width="100px" Enabled="False"></asp:TextBox>
                                    <asp:Label ID="lblmsg" runat="server" ForeColor="Red"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkChoose" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
=======
                <div class="span12" style="overflow-y:scroll; height:400px;">
                    <asp:GridView ID="CatelogueView" GridLines="None" runat="server" AutoGenerateColumns="False"
                        CssClass="table table-hover" Width="598px">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:HiddenField ID="itemCode" Value='<%#Eval("Item_Code") %>' runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Item_Description" HeaderText="Description" />
                            <asp:BoundField DataField="Measurement" HeaderText="Unit Of Measurement" />
                            <asp:TemplateField HeaderText="Quantity">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtQty" runat="server" Width="100px" Enabled="False"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkChoose" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
>>>>>>> .r28
                    </asp:GridView>
                    
                    <%--<asp:HyperLink ID="btnAddTo" runat="server" CssClass="btn"><i class="icon-plus"></i>Add</asp:HyperLink>--%>
                    
                    
                </div>
            </div>
<<<<<<< .mine
            <br /><br />
            <asp:Button ID="add"  runat="server" CssClass="btn btn-primary pull-right" 
                Text="Add" onclick="add_Click" Enabled="False" />
            </div>
            
        <div class="span4 text-center well">
            <h5>Selected Items</h5>
            <span class="divider"></span>
            <asp:GridView ID="selectedItemView" CssClass="table" GridLines="None" 
                runat="server" AutoGenerateColumns="False" 
                Width="201px">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="selectedItemCode" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField AccessibleHeaderText="Test">
                        <ItemTemplate>
                            <asp:Label ID="selectedItemDesc" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:TextBox ID="selectedQty" pattern="[0-9]*" required="required" runat="server" Width="80px"></asp:TextBox>
                            <asp:Label ID="lblerror" runat="server" ForeColor="Red"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="removeLink" 
                                CommandArgument="<%# Container.DataItemIndex %>" runat="server" SkinID="remove" 
                                onclick="removeLink_Click">Remove</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Table ID="selectedTable" runat="server">
            </asp:Table>
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
                CssClass="btn btn-primary" onclick="btnSubmit_Click" Visible="False" />
=======
            <br /><br />
            <asp:Button ID="add"  runat="server" CssClass="btn btn-primary pull-right" Text="Add" onclick="add_Click" />
            </div>
            
        <div class="span4 text-center well">
            <h5>Selected Items</h5>
            <span class="divider"></span>
            <asp:GridView ID="selectedItemView" CssClass="table" GridLines="None" 
                runat="server" AutoGenerateColumns="False" 
                Width="201px">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="selectedItemCode" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField AccessibleHeaderText="Test">
                        <ItemTemplate>
                            <asp:Label ID="selectedItemDesc" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:TextBox ID="selectedQty" runat="server" Width="80px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="removeLink" 
                                CommandArgument="<%# Container.DataItemIndex %>" runat="server" SkinID="remove" 
                                onclick="removeLink_Click">Remove</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Table ID="selectedTable" runat="server">
            </asp:Table>
            <asp:Button ID="btnSubmit" Enabled="false" runat="server" Text="Submit" 
                CssClass="btn btn-primary" onclick="btnSubmit_Click" />
>>>>>>> .r28
        </div>
    </div>
    </form>
<<<<<<< .mine
    
    <script type="text/javascript">
        var length = $('#content_CatelogueView').find('tr input:text').length;

        $('#content_CatelogueView tr input:checkbox').click(function () {
            var chk = $(this).parents("tr:first").find("input:checkbox");
            var txt = $(this).parents("tr:first").find("input:text");
            var btnAdd = $('#content_btnAdd');

            //            console.log(chk.attr('type'));
            //            console.log(txt.attr("type"));

            if (chk.is(':checked')) {
                txt.attr('disabled', false);
                btnAdd.attr('disabled', false);
                $('#content_add').attr('disabled', false);
            }
            else {
                $('#content_add').attr('disabled', true);
                txt.attr('disabled', true);
                txt.val('');
            }
        });

        </script>
        <script type="text/javascript">
            $('#content_CatelogueView tr input:text').keydown(function (event) {
                $('#content_add').attr('disabled', false);
                var state = true;
                if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
					(event.keyCode == 65 && event.ctrlKey === true) || (event.keyCode >= 35 && event.keyCode <= 39)) {
                    
                    return;
                }

                if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                    alert('Invalid Quantity');
                    state = false;
                    //
                }

                if (!state) {
                    $('#content_add').attr('disabled', true);
                }
            });
		</script>
        <%--<script type="text/javascript">
            if ($('content_noti').val() != 'Delegated') {
                $('.hero-unit').css('display', 'none');
            }
        </script>--%>
=======
    
    <script type="text/javascript">
        var length = $('#content_CatelogueView').find('tr input:text').length;

        $('#content_CatelogueView tr input:checkbox').click(function () {
            var chk = $(this).parents("tr:first").find("input:checkbox");
            var txt = $(this).parents("tr:first").find("input:text");
            var btnAdd = $('#content_btnAdd');

            //            console.log(chk.attr('type'));
            //            console.log(txt.attr("type"));

            if (chk.is(':checked')) {
                txt.attr('disabled', false);
                btnAdd.attr('disabled', false);
                $('#content_add').attr('disabled', false);
            }
            else {
                $('#content_add').attr('disabled', true);
                txt.attr('disabled', true);
                txt.val('');
            }
        });

        </script>
        <script type="text/javascript">
            $('#content_CatelogueView tr input:text').keydown(function (event) {
                $('#content_add').attr('disabled', false);
                var state = true;
                if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
					(event.keyCode == 65 && event.ctrlKey === true) || (event.keyCode >= 35 && event.keyCode <= 39)) {
                    
                    return;
                }

                if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                    alert('Invalid Quantity');
                    state = false;
                    //
                }

                if (!state) {
                    $('#content_add').attr('disabled', true);
                }
            });
		</script>
       
    <script type="text/javascript">
        $('#content_selectedTable a').click(function () {
            $(this).parents('tr').remove();
        });
    </script>
>>>>>>> .r28
</asp:Content>
